{template "header.html"}
<div class="note note-danger">
    <p>当前应用程序的控制器目录是：{APPSPATH}{$dir}/Controllers/</p>
</div>
<div class="right-card-box">
<form class="form-horizontal" role="form" id="myform">
    {dr_form_hidden()}
    <div class="table-scrollable">
        <table class="table table-striped table-bordered  table-checkable dataTable">
            <thead>
            <tr class="heading">
                <th width="120" style="text-align:center"> {dr_lang('权限')} </th>
                <th width="330"> {dr_lang('应用目录')}</th>
                <th> {dr_lang('操作')} </th>
            </tr>
            </thead>
            <tbody>
            {loop $list $tid $t}
            <tr class="odd gradeX">
                <td style="text-align:center">{$t.type}</td>
                <td>{$t.path}</td>
                <td>
                    <label><a href="javascript:dr_iframe('创建空白控制器', '{dr_url('dever/home/c_add', ['dir'=>$dir, 'tid' => $tid])}', '60%','610px');" class="btn btn-xs blue"> <i class="fa fa-plus"></i> {dr_lang('创建空白控制器')} </a></label>
                    {if in_array($tid, ['admin', 'member'])}
                    <label><a href="javascript:dr_iframe('创建数据控制器', '{dr_url('dever/home/db_add', ['dir'=>$dir, 'tid' => $tid])}', '60%','610px');" class="btn btn-xs red"> <i class="fa fa-plus"></i> {dr_lang('创建数据控制器')} </a></label>
                    {/if}
                </td>
            </tr>
            {loop $t.file $file}
            <?php
            $fpath = APPSPATH.$dir.'/Controllers/'.ucfirst($tid).'/'.$file;
$uri = strtolower($dir.'/'.str_replace('.php', '', $file).'/index');
if ($tid == 'admin') {
    $url = dr_url($uri);
} elseif ($tid == 'member') {
    $url = dr_member_url($uri);
} else {
    $url = dr_url($uri, '', 'index.php');
}

?>
            <tr>
                <td style="text-align:center"></td>
                <td>
                <div >
                    <a href="javascript:dr_iframe_show('控制器', '{dr_url('dever/home/show', ['dir'=>$dir, 'file'=>$file, 'tid' => $tid])}', '80%');">{$file}</a>
                </div>
                </td>
                <td>
                    <label><a href="{$url}" target="_blank" class="btn btn-xs yellow">  {dr_lang('访问')} </a></label>
                    {if is_file(str_replace('.php', '.json', $fpath))}
                    <label><a href="javascript:dr_iframe('字段设置：{$fpath}', '{dr_url('dever/home/db_field', ['dir'=>$dir, 'file'=>$file, 'tid' => $tid])}', '80%','','nogo');" class="btn btn-xs green">  {dr_lang('字段设置')} </a></label>
                    <label><a href="javascript:dr_iframe('列表设置：{$fpath}', '{dr_url('dever/home/db_list', ['dir'=>$dir, 'file'=>$file, 'tid' => $tid])}', '80%','','nogo');" class="btn btn-xs blue">  {dr_lang('列表设置')} </a></label>
                    {/if}
                </td>
            </tr>
            {/loop}

            {php $i++;}
            {/loop}
            </tbody>
        </table>
    </div>


</form>
</div>


{template "footer.html"}